<template>
    <div class="el-mr-parreturnSearch">
      <div>
        <el-button size="mini" type="primary" @click="prSearching">查询</el-button>
      </div>
      <div>
        <ul>
        <li style="width:30%">
          
          <el-input
            size="small"
            v-model="jixing"
            placeholder="请输入机型"
            class = "input"
          ></el-input>
          <span>机型:</span>
        </li>
        <li style="width:30%">
          
          <el-input
            size="small"
            v-model="pici"
            placeholder="请输入批次"
            class = "input"
          ></el-input>
          <span>批次：</span>
        </li>
        <li style="width:30%">
          <el-input
            size="small"
            v-model="startjiaci"
            placeholder="请输入起始架次"
            class = "input"
          ></el-input>
          <span>起始架次：</span>
        </li>
      </ul>
      </div>
    </div>
  </template>
  <script>
  import { supportingTaskTop } from "@/utils/api.js"
  
  export default {
    name: "ImFqTopInput",
    data() {
      return {
        // 分页参数
        pageInfoNum:10,
        pageNum:1,
        // 机型
        jixing:"",
        //  批次
        pici: "",
        //  起始架次
        startjiaci: ""
      };
    },
    methods:{
       // 零件退货本页TOP查询按钮
      prSearching(){
        supportingTaskTop({
          searchParams:{
            // 机型
            productCode:this.jixing, 
            // 批次
            batchNo:this.pici,
            // 起始架次
            startLotNo:this.startjiaci
          },
          pageParameter:{
            rows:this.pageInfoNum,
            page:this.pageNum
          }
        }).then((res)=>{
          console.log('故障改派查询',res)
          // 将数据传给Table进行显示
          this.$bus.$emit('prSearchInfo',res.data.responseBody.result)
        })
        
      },  
    },
    mounted(){
      // Table每页展示数量变化的val，查询数据并返回数据
      this.$bus.$on('prtMidTableDataNum',(e)=>{
        // 每页条数赋值
        this.pageInfoNum = e
        supportingTaskTop({
          searchParams:{
            
            // 机型
            productCode:this.jixing, 
            // 批次
            batchNo:this.pici,
            // 起始架次
            startLotNo:this.startjiaci
          },
          pageParameter:{
            rows:this.pageInfoNum,
            page:this.pageNum
          }
        }).then((res)=>{
          // 将数据传给Table进行显示
          this.$bus.$emit('prSearchInfo',res.data.responseBody.result)
        })
      })
    }
  };
  </script>
  <style scoped>
  .el-select {
    width: 160px;
  }
  .el-input {
    width: 160px;
  }
  .el-mr-parreturnSearch {
    width: 100%;
    /* height: 200px; */
    overflow: hidden;
    margin-top: 10px;
    border-bottom: 1px dotted rgb(141, 129, 129);
  }
  .input{
    width: 60%;
  }
  .el-mr-parreturnSearch ul li {
    float: left;
    width: 23%;
    height: 30px;
    line-height: 30px;
    margin-right: 1%;
    margin-bottom: 5px;
    overflow: hidden;
  }
  .el-mr-parreturnSearch ul li span {
    float: right;
  }
  .el-mr-parreturnSearch ul li div {
    float: right;
  }
  </style>